package com.woniuxy01;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-05-26 9:34
 */
public class Test04 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        boolean flag = false;
        for(int i=1;i<=3;i++){
            System.out.println("输入用户名");
            String name = sc.next();
            System.out.println("输入密码");
            String pwd = sc.next();
            if("a".equals(name)&&"aaa".equals(pwd)){
                flag=true;
                break;
            }else{
                System.out.println("还有"+(3-i)+"次机会");
            }
        }

        if(flag){
            System.out.println("进入系统");
        }else{
            System.out.println("三次机会用完了，无法进入系统");
        }
    }
}
